package com.analyse.stock.model;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.annotation.JSONField;
import com.analyse.stock.vo.StockExchangeVO;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_stock_exchange")
public class StockExchangeModel extends BaseModel<StockExchangeModel> {
    //交易所代码。采用ISO市场标识码MIC（Market identifier codes)例如：XSHG（上交所）、XSHE（深交所）、XNAS（纳斯达克）
    private String exchangeCode;
    //交易所名称
    private String exchangeName;
    //交易所简称
    private String exchangeNameShort;
    //国家/地区代码。详见国家/地区清单接口。例如：CHN（中国）、USA（美国）
    private String countryCode;
    //币种代码
    private String currencyCode;
    //开盘时间（当地）。格式：hh:mm:ss
    private String localOpen;
    //收盘时间（当地）。格式：hh:mm:ss
    private String localClose;
    //开盘时间（北京）。格式：hh:mm:ss
    private String beijingOpen;
    //收盘时间（北京）。格式：hh:mm:ss
    private String beijingClose;
    //时区
    private String timezone;
    //延时
    private String delay;
    //备注
    private String notes;
    //关联指数，后续做大盘情绪分析和均线
    private String conrrelaIndex;

    public static StockExchangeModel transStockExchangeModel(StockExchangeVO exchangeVO){
        StockExchangeModel model = new StockExchangeModel();
        BeanUtil.copyProperties(exchangeVO,model);
        model.setUpdateTime(new Date());
        model.setCreateTime(new Date());
        return model;
    }
}
